package com.ssy.lingxi.gateway.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class FallbackController {

    @RequestMapping("/fallback")
    public ResponseEntity<?> fallback() {
        System.out.println("调用fallback接口拉。。。。");
        System.out.println("调用fallback接口拉。。。。");
        System.out.println("调用fallback接口拉。。。。");
        System.out.println("调用fallback接口拉。。。。");

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("T", System.currentTimeMillis());
        map.put("S", 0);
        map.put("M", "服务不可用");
        map.put("R", null);


        return ResponseEntity.ok(map);
    }

//    @RequestMapping("/fallback")
//    public String fallback() {
//        System.out.println("调用fallback接口拉。。。。");
//        System.out.println("调用fallback接口拉。。。。");
//        System.out.println("调用fallback接口拉。。。。");
//        System.out.println("调用fallback接口拉。。。。");
//
//        return "forward:/member/login";
//    }
}
